/**
 * Created with IntelliJ IDEA.
 * User: duoba
 * Date: 16/2/25
 * Time: 上午9:01
 * To change this template use File | Settings | File Templates.
 */

package com.cake21.uitest.Page;

import com.cake21.uitest.Constant.Constants;
import com.cake21.uitest.System.Core.Page;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class LoginPage extends Page {
    /*页面元素*/
    @FindBy(name = "uname")
    private WebElement userInput;
    @FindBy(name = "password")
    private WebElement pwdInput;
    @FindBy(id = "IDlogin")
    private WebElement loginBtn;

    /*输入用户名*/
    public void enterUser() {
        this.userInput.sendKeys(Constants.UserName);
    }

    /*输入密码*/
    public void enterPwd() {
        this.pwdInput.sendKeys(Constants.Pwd);
    }

    /*点击登录*/
    public void pressLoginBtn() {
        this.loginBtn.click();
    }

    /*构造函数*/
    public LoginPage(WebDriver driver) {
        this.driver = driver;
    }

}
